package com.ayun.member.config;

import com.ayun.member.filter.AuthenticationFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author 斌叔
 * @description: 配置拦截器类
 * @create 2022-05-09 19:35
 */
@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {

    @Autowired
    private AuthenticationFilter authenticationFilter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authenticationFilter)
                .addPathPatterns("/**")
                .excludePathPatterns("/staff");
//                .excludePathPatterns("/staff/login"); // 排除登录接口
    }

}
